package de.servicezombie.tcmdb.rest.vo;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * <p>A single step needed to be executed to complete a testcase execution</p>
 * <b>Example:</b>
 * <pre>tetcaseStep { 
 *   index: 0, 
 *   text: "a short one liner", 
 *   expectedResult: "a one liner describing the result" 
 * }
 * </pre>
 * @author ChKa
 * @version n.a.
 */
@XmlRootElement(name = "step")
@XmlAccessorType(XmlAccessType.FIELD)
public class WsTestcaseStep extends AbstractWsDomainObjectWithId<WsTestcaseStep> implements Comparable<WsTestcaseStep> {
	
	@XmlElement(name="index")
	private int index;
	
	@XmlElement(name="text")
	private String text;
	
	@XmlElement(name="expectedResult")
	private String expectedResult;

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getExpectedResult() {
		return expectedResult;
	}

	public void setExpectedResult(String expectedResult) {
		this.expectedResult = expectedResult;
	}

	/**
	 * compare steps based on their index;
	 */
	@Override
	public int compareTo(WsTestcaseStep o) {
		return index - o.index;
	}

}
